package com.example.pages;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

public class MyProfilePage extends InternalPage {
	
	@FindBy(id= "email")
	public WebElement emailField;
	
	@FindBy(name= "submit")
	public WebElement saveButton;
	
	public UserManagementPage changeEmailTo(String newEmail) {
		emailField.clear();
		emailField.sendKeys(newEmail);
		saveButton.click();
		return MyPageFactory.getPage(driver, UserManagementPage.class);
	}
	
	public boolean isEmailNew(String email) {
		return emailField.getText().equals(email);
}
}
